package test;

import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Provider;
import org.bhf.facilities.ProjectInjectors;
import org.bhf.service.ServiceModule;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class Application implements ServletContextListener
{
    public void contextInitialized( ServletContextEvent event )
    {
        ProjectInjectors.bindDefaultInjector( new Provider<Injector>()
        {
            public Injector get()
            {
                return Guice.createInjector(
                    new ServiceModule()
                );
            }
        } );

        new TestServiceGroup();
    }

    public void contextDestroyed( ServletContextEvent event )
    {
    }
}
